/**
 * jims
 */
package com.jims.master.modules.doctor.dao;

import com.jims.master.common.persistence.CrudDao;
import com.jims.master.common.persistence.annotation.MyBatisDao;
import com.jims.master.modules.doctor.entity.ClinicMaster;
import com.jims.master.modules.doctor.entity.PatMasterIndex;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 病人就诊信息DAO接口
 * @author 赵宁
 * @version 2017-02-28
 */
@MyBatisDao
public interface ClinicMasterDao extends CrudDao<ClinicMaster> {
    /**
     * 获取当天最大visitNo
     * @param orgId
     * @param visitDate
     * @return  int
     * @author 赵宁
     */
    public int getMaxNo(@Param("visitDate") String visitDate, @Param("orgId") String orgId);

    /**
     * 挂号单打印
     * @param clinicMaster
     * @return
     * @author chentao
     */
    public ClinicMaster clinicMasterPrint(ClinicMaster clinicMaster);
    /**
     * 退号管理查询 挂号信息
     * @param clinicMaster
     * @return List<ClinicMaster>
     * @author 赵宁
     */
    public List<ClinicMaster> searchClinicRegInfo(ClinicMaster clinicMaster);

    /**
     * 退号时更新 就诊信息的有关退号数据
     * @param clinicMaster
     * @return int
     * @author 赵宁
     */
    public int updateCMByBackReg(ClinicMaster clinicMaster);

    /**
     * 修改状态为已经就诊
     * @param clinicMaster
     * @return
     */
    public int updateClinicType(ClinicMaster clinicMaster);

    /**
     * @return
     */
    public List<PatMasterIndex> getPatsByDoctor(PatMasterIndex patMasterIndex);

    /**
     * 门诊结算页面
     * @param clinicMaster
     * @return
     * @author 陈涛
     */
    public ClinicMaster clinicCheckout(ClinicMaster clinicMaster);

    /**
     * 结账确认修改clinicMaster结账号
     * @return
     * @author 陈涛
     */
    public int saveAcctNo(ClinicMaster clinicMaster);


    /**
     * 挂号结账--查询 支付方式金额
     * @param clinicMaster
     * @return List<ClinicMaster>
     * @author 赵宁
     */
    public List<ClinicMaster> findCharges(ClinicMaster clinicMaster);

    /**
     * @desc 根据页面多条件查询患者列表
     * @param
     * @return
     * 陈晓阳
     */
    public List<ClinicMaster> findPatientByConditions(ClinicMaster clinicMaster);

    /**
     * 修改门诊病人列表
     * @param clinicMaster
     * @return
     */
    public int updateClinicPatInfo(ClinicMaster clinicMaster);

    public ClinicMaster getById(@Param("id") String id);
    /**
     * 根据门诊号获取病人就诊信息
     * @param clinicNo
     * @param orgId
     * @return ClinicMaster
     * @author 赵宁
     */
    public ClinicMaster getMasterByClinicNo(@Param("clinicNo") String clinicNo, @Param("orgId") String orgId);
    /**
     * 根据病人Id查询门诊就诊记录
     * @param patId
     * @return
     * @Author  樊多
     */
    public ClinicMaster findClinicMasterByPatId(@Param("patId") String patId);

    /**
     * 根据id获取打印信息
     * @param id
     * @return
     */
    public ClinicMaster getPrintInfo(@Param("patientId") String patientId);

    /**
     * 查询当前挂号员的最小挂号日期
     * @param clinicMaster
     * @return
     * @author 赵宁
     */
    public String getMinRegistDate(ClinicMaster clinicMaster);

    /**
     * 挂号结账统计挂号数量
     * @param acctNo
     * @return
     * @author 赵宁
     */
    public ClinicMaster printStatisRegistCount(@Param("acctNo") String acctNo);

}